'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});
var supportPassive = true;
try {
    window.addEventListener('click', null, {
        passive: true
    });
} catch (err) {
    supportPassive = false;
}

var addEventListener = exports.addEventListener = function addEventListener(dom, eventName, fn) {
    dom.addEventListener(eventName, fn, {
        passive: true
    });
};
var removeEventListener = exports.removeEventListener = function removeEventListener(dom, eventName, fn) {
    dom.removeEventListener(eventName, fn, {
        passive: true
    });
};

var preventDefault = exports.preventDefault = function preventDefault(e) {
    if (e.cancelable && !e.defaultPrevented) {
        e.preventDefault();
    }
};

exports.default = addEventListener;